// next.config.js
/** @type {import('next').NextConfig} */
const path = require("path");

const nextConfig = {
    basePath: "/hicproject",
    // assetPrefix: "/hicproject",
    reactStrictMode: false,
    swcMinify: true, // 使用 Next.js 自带的 SWC 压缩器
    experimental: {
        // 如果你项目里确实要用 CSS 优化，再开启
        // optimizeCss: true,
    },
    // 如果你有特定 webpack 配置需求
    webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
        config.resolve.alias["@"] = path.join(__dirname, "src");
        return config;
    },
    images: {
        remotePatterns: [
            {
                protocol: "http",
                hostname: "127.0.0.1",
                port: "8005",
                pathname: "/images/**",
            },
            {
                protocol: "http",
                hostname: "wulab.bjmu.edu.cn",
                // 注意：生产环境通常使用默认的 80/443 端口，所以 port 可以省略
                // pathname: "/hicproject/static/images/**",
                // 为了更灵活，你可以只设置 pathnamePrefix，让它匹配所有以 /hicproject/static/images/ 开头的路径
                pathname: "/hicproject/static/images/**",
            },
        ],
    },
};

module.exports = nextConfig;
